package com.itheima.mapper;

import com.itheima.common.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liguoping
 */
@Mapper
public interface EmployeeMapper {
    //    @Select(("select * from employee where username=#{username} and password=#{password}"))
    Employee selectEmployeeByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    void updateToken(@Param("token") String token, @Param("id") String id);

    Employee getByToken(@Param("token") String token);

    void clearToken(@Param("id") String id);

    Employee getById(@Param("id") String id);

    int save(Employee employee);

    List<Employee> page(@Param("name") String name, @Param("start") Integer start, @Param("pageSize") Integer pageSize);

    long countEmployee(@Param("name") String name);

    List<Employee> selectByIds(@Param("ids") List<String> ids);

    int updateEmployee(Employee employee);
}
